\(\int (g+h x)^3 (A+B \log (e (a+b x)^n (c+d x)^{-n})) \, dx\) [294]

   Optimal result
   Rubi [A] (verified)
   Mathematica [A] (verified)
   Maple [B] (verified)
   Fricas [B] (verification not implemented)
   Sympy [F(-2)]
   Maxima [B] (verification not implemented)
   Giac [F(-1)]
   Mupad [B] (verification not implemented)

Optimal result

Integrand size = 31, antiderivative size = 236 \[ \int (g+h x)^3 \left (A+B \log \left (e (a+b x)^n (c+d x)^{-n}\right )\right ) \, dx=-\frac {B (b c-a d) h \left (a^2 d^2 h^2-a b d h (4 d g-c h)+b^2 \left (6 d^2 g^2-4 c d g h+c^2 h^2\right )\right ) n x}{4 b^3 d^3}-\frac {B (b c-a d) h^2 (4 b d g-b c h-a d h) n x^2}{8 b^2 d^2}-\frac {B (b c-a d) h^3 n x^3}{12 b d}-\frac {B (b g-a h)^4 n \log (a+b x)}{4 b^4 h}+\frac {B (d g-c h)^4 n \log (c+d x)}{4 d^4 h}+\frac {(g+h x)^4 \left (A+B \log \left (e (a+b x)^n (c+d x)^{-n}\right )\right )}{4 h} \]

[Out]

-1/4*B*(-a*d+b*c)*h*(a^2*d^2*h^2-a*b*d*h*(-c*h+4*d*g)+b^2*(c^2*h^2-4*c*d*g*h+6*d^2*g^2))*n*x/b^3/d^3-1/8*B*(-a
*d+b*c)*h^2*(-a*d*h-b*c*h+4*b*d*g)*n*x^2/b^2/d^2-1/12*B*(-a*d+b*c)*h^3*n*x^3/b/d-1/4*B*(-a*h+b*g)^4*n*ln(b*x+a
)/b^4/h+1/4*B*(-c*h+d*g)^4*n*ln(d*x+c)/d^4/h+1/4*(h*x+g)^4*(A+B*ln(e*(b*x+a)^n/((d*x+c)^n)))/h

Rubi [A] (verified)

Time = 0.20 (sec) , antiderivative size = 236, normalized size of antiderivative = 1.00, number of steps used = 3, number of rules used = 2, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.065, Rules used = {2548, 84} \[ \int (g+h x)^3 \left (A+B \log \left (e (a+b x)^n (c+d x)^{-n}\right )\right ) \, dx=-\frac {B h n x (b c-a d) \left (a^2 d^2 h^2-a b d h (4 d g-c h)+b^2 \left (c^2 h^2-4 c d g h+6 d^2 g^2\right )\right )}{4 b^3 d^3}+\frac {(g+h x)^4 \left (B \log \left (e (a+b x)^n (c+d x)^{-n}\right )+A\right )}{4 h}-\frac {B n (b g-a h)^4 \log (a+b x)}{4 b^4 h}-\frac {B h^2 n x^2 (b c-a d) (-a d h-b c h+4 b d g)}{8 b^2 d^2}-\frac {B h^3 n x^3 (b c-a d)}{12 b d}+\frac {B n (d g-c h)^4 \log (c+d x)}{4 d^4 h} \]

[In]

Int[(g + h*x)^3*(A + B*Log[(e*(a + b*x)^n)/(c + d*x)^n]),x]

[Out]

-1/4*(B*(b*c - a*d)*h*(a^2*d^2*h^2 - a*b*d*h*(4*d*g - c*h) + b^2*(6*d^2*g^2 - 4*c*d*g*h + c^2*h^2))*n*x)/(b^3*
d^3) - (B*(b*c - a*d)*h^2*(4*b*d*g - b*c*h - a*d*h)*n*x^2)/(8*b^2*d^2) - (B*(b*c - a*d)*h^3*n*x^3)/(12*b*d) -
(B*(b*g - a*h)^4*n*Log[a + b*x])/(4*b^4*h) + (B*(d*g - c*h)^4*n*Log[c + d*x])/(4*d^4*h) + ((g + h*x)^4*(A + B*
Log[(e*(a + b*x)^n)/(c + d*x)^n]))/(4*h)

Rule 84

Int[((e_.) + (f_.)*(x_))^(p_.)/(((a_.) + (b_.)*(x_))*((c_.) + (d_.)*(x_))), x_Symbol] :> Int[ExpandIntegrand[(
e + f*x)^p/((a + b*x)*(c + d*x)), x], x] /; FreeQ[{a, b, c, d, e, f}, x] && IntegerQ[p]

Rule 2548

Int[((A_.) + Log[(e_.)*((a_.) + (b_.)*(x_))^(n_.)*((c_.) + (d_.)*(x_))^(mn_)]*(B_.))*((f_.) + (g_.)*(x_))^(m_.
), x_Symbol] :> Simp[(f + g*x)^(m + 1)*((A + B*Log[e*((a + b*x)^n/(c + d*x)^n)])/(g*(m + 1))), x] - Dist[B*n*(
(b*c - a*d)/(g*(m + 1))), Int[(f + g*x)^(m + 1)/((a + b*x)*(c + d*x)), x], x] /; FreeQ[{a, b, c, d, e, f, g, A
, B, m, n}, x] && EqQ[n + mn, 0] && NeQ[b*c - a*d, 0] && NeQ[m, -1] &&  !(EqQ[m, -2] && IntegerQ[n])

Rubi steps \begin{align*} \text {integral}& = \frac {(g+h x)^4 \left (A+B \log \left (e (a+b x)^n (c+d x)^{-n}\right )\right )}{4 h}-\frac {(B (b c-a d) n) \int \frac {(g+h x)^4}{(a+b x) (c+d x)} \, dx}{4 h} \\ & = \frac {(g+h x)^4 \left (A+B \log \left (e (a+b x)^n (c+d x)^{-n}\right )\right )}{4 h}-\frac {(B (b c-a d) n) \int \left (\frac {h^2 \left (a^2 d^2 h^2-a b d h (4 d g-c h)+b^2 \left (6 d^2 g^2-4 c d g h+c^2 h^2\right )\right )}{b^3 d^3}+\frac {h^3 (4 b d g-b c h-a d h) x}{b^2 d^2}+\frac {h^4 x^2}{b d}+\frac {(b g-a h)^4}{b^3 (b c-a d) (a+b x)}+\frac {(d g-c h)^4}{d^3 (-b c+a d) (c+d x)}\right ) \, dx}{4 h} \\ & = -\frac {B (b c-a d) h \left (a^2 d^2 h^2-a b d h (4 d g-c h)+b^2 \left (6 d^2 g^2-4 c d g h+c^2 h^2\right )\right ) n x}{4 b^3 d^3}-\frac {B (b c-a d) h^2 (4 b d g-b c h-a d h) n x^2}{8 b^2 d^2}-\frac {B (b c-a d) h^3 n x^3}{12 b d}-\frac {B (b g-a h)^4 n \log (a+b x)}{4 b^4 h}+\frac {B (d g-c h)^4 n \log (c+d x)}{4 d^4 h}+\frac {(g+h x)^4 \left (A+B \log \left (e (a+b x)^n (c+d x)^{-n}\right )\right )}{4 h} \\ \end{align*}

Mathematica [A] (verified)

Time = 0.39 (sec) , antiderivative size = 314, normalized size of antiderivative = 1.33 \[ \int (g+h x)^3 \left (A+B \log \left (e (a+b x)^n (c+d x)^{-n}\right )\right ) \, dx=\frac {b d x \left (6 A b^3 d^3 \left (4 g^3+6 g^2 h x+4 g h^2 x^2+h^3 x^3\right )-B (b c-a d) h n \left (6 a^2 d^2 h^2-3 a b d h (8 d g-2 c h+d h x)+b^2 \left (6 c^2 h^2-3 c d h (8 g+h x)+2 d^2 \left (18 g^2+6 g h x+h^2 x^2\right )\right )\right )\right )-6 a^2 B d^4 h \left (6 b^2 g^2-4 a b g h+a^2 h^2\right ) n \log (a+b x)+6 b^3 B \left (4 a d^4 g^3+b c \left (-4 d^3 g^3+6 c d^2 g^2 h-4 c^2 d g h^2+c^3 h^3\right )\right ) n \log (c+d x)+6 b^3 B d^4 \left (4 a g^3+b x \left (4 g^3+6 g^2 h x+4 g h^2 x^2+h^3 x^3\right )\right ) \log \left (e (a+b x)^n (c+d x)^{-n}\right )}{24 b^4 d^4} \]

[In]

Integrate[(g + h*x)^3*(A + B*Log[(e*(a + b*x)^n)/(c + d*x)^n]),x]

[Out]

(b*d*x*(6*A*b^3*d^3*(4*g^3 + 6*g^2*h*x + 4*g*h^2*x^2 + h^3*x^3) - B*(b*c - a*d)*h*n*(6*a^2*d^2*h^2 - 3*a*b*d*h
*(8*d*g - 2*c*h + d*h*x) + b^2*(6*c^2*h^2 - 3*c*d*h*(8*g + h*x) + 2*d^2*(18*g^2 + 6*g*h*x + h^2*x^2)))) - 6*a^
2*B*d^4*h*(6*b^2*g^2 - 4*a*b*g*h + a^2*h^2)*n*Log[a + b*x] + 6*b^3*B*(4*a*d^4*g^3 + b*c*(-4*d^3*g^3 + 6*c*d^2*
g^2*h - 4*c^2*d*g*h^2 + c^3*h^3))*n*Log[c + d*x] + 6*b^3*B*d^4*(4*a*g^3 + b*x*(4*g^3 + 6*g^2*h*x + 4*g*h^2*x^2
 + h^3*x^3))*Log[(e*(a + b*x)^n)/(c + d*x)^n])/(24*b^4*d^4)

Maple [B] (verified)

Leaf count of result is larger than twice the leaf count of optimal. \(983\) vs. \(2(224)=448\).

Time = 33.09 (sec) , antiderivative size = 984, normalized size of antiderivative = 4.17

method result size
parallelrisch \(\frac {12 B \,a^{2} b^{2} c \,d^{3} g \,h^{2} n^{2}-12 B a \,b^{3} c^{2} d^{2} g \,h^{2} n^{2}-36 A a \,b^{3} c \,d^{3} g^{2} h n -6 B \ln \left (e \left (b x +a \right )^{n} \left (d x +c \right )^{-n}\right ) b^{4} c^{4} h^{3} n +24 B \ln \left (e \left (b x +a \right )^{n} \left (d x +c \right )^{-n}\right ) b^{4} c^{3} d g \,h^{2} n -36 B \ln \left (e \left (b x +a \right )^{n} \left (d x +c \right )^{-n}\right ) b^{4} c^{2} d^{2} g^{2} h n +24 B \,x^{3} \ln \left (e \left (b x +a \right )^{n} \left (d x +c \right )^{-n}\right ) b^{4} d^{4} g \,h^{2} n +36 B \,x^{2} \ln \left (e \left (b x +a \right )^{n} \left (d x +c \right )^{-n}\right ) b^{4} d^{4} g^{2} h n -12 B \,x^{2} b^{4} c \,d^{3} g \,h^{2} n^{2}+6 A \,x^{4} b^{4} d^{4} h^{3} n +24 A x \,b^{4} d^{4} g^{3} n -6 B \ln \left (b x +a \right ) a^{4} d^{4} h^{3} n^{2}+6 B \ln \left (b x +a \right ) b^{4} c^{4} h^{3} n^{2}-24 A a \,b^{3} d^{4} g^{3} n -24 A \,b^{4} c \,d^{3} g^{3} n -24 B x \,a^{2} b^{2} d^{4} g \,h^{2} n^{2}+36 B x a \,b^{3} d^{4} g^{2} h \,n^{2}+24 B x \,b^{4} c^{2} d^{2} g \,h^{2} n^{2}-36 B x \,b^{4} c \,d^{3} g^{2} h \,n^{2}+24 B \ln \left (b x +a \right ) a^{3} b \,d^{4} g \,h^{2} n^{2}-36 B \ln \left (b x +a \right ) a^{2} b^{2} d^{4} g^{2} h \,n^{2}-24 B \ln \left (b x +a \right ) b^{4} c^{3} d g \,h^{2} n^{2}+36 B \ln \left (b x +a \right ) b^{4} c^{2} d^{2} g^{2} h \,n^{2}+12 B \,x^{2} a \,b^{3} d^{4} g \,h^{2} n^{2}+2 B \,x^{3} a \,b^{3} d^{4} h^{3} n^{2}-2 B \,x^{3} b^{4} c \,d^{3} h^{3} n^{2}+24 A \,x^{3} b^{4} d^{4} g \,h^{2} n -3 B \,x^{2} a^{2} b^{2} d^{4} h^{3} n^{2}+3 B \,x^{2} b^{4} c^{2} d^{2} h^{3} n^{2}+36 A \,x^{2} b^{4} d^{4} g^{2} h n +24 B \ln \left (b x +a \right ) a \,b^{3} d^{4} g^{3} n^{2}+6 B x \,a^{3} b \,d^{4} h^{3} n^{2}-6 B x \,b^{4} c^{3} d \,h^{3} n^{2}-24 B \ln \left (b x +a \right ) b^{4} c \,d^{3} g^{3} n^{2}-6 B \,a^{4} d^{4} h^{3} n^{2}+6 B \,b^{4} c^{4} h^{3} n^{2}-3 B \,a^{3} b c \,d^{3} h^{3} n^{2}+24 B \,a^{3} b \,d^{4} g \,h^{2} n^{2}-36 B \,a^{2} b^{2} d^{4} g^{2} h \,n^{2}+3 B a \,b^{3} c^{3} d \,h^{3} n^{2}-24 B \,b^{4} c^{3} d g \,h^{2} n^{2}+36 B \,b^{4} c^{2} d^{2} g^{2} h \,n^{2}+6 B \,x^{4} \ln \left (e \left (b x +a \right )^{n} \left (d x +c \right )^{-n}\right ) b^{4} d^{4} h^{3} n +24 B x \ln \left (e \left (b x +a \right )^{n} \left (d x +c \right )^{-n}\right ) b^{4} d^{4} g^{3} n +24 B \ln \left (e \left (b x +a \right )^{n} \left (d x +c \right )^{-n}\right ) b^{4} c \,d^{3} g^{3} n}{24 b^{4} d^{4} n}\) \(984\)
risch \(\text {Expression too large to display}\) \(2000\)

[In]

int((h*x+g)^3*(A+B*ln(e*(b*x+a)^n/((d*x+c)^n))),x,method=_RETURNVERBOSE)

[Out]

1/24*(12*B*a^2*b^2*c*d^3*g*h^2*n^2-12*B*a*b^3*c^2*d^2*g*h^2*n^2-36*A*a*b^3*c*d^3*g^2*h*n-12*B*x^2*b^4*c*d^3*g*
h^2*n^2+6*A*x^4*b^4*d^4*h^3*n+24*A*x*b^4*d^4*g^3*n-6*B*ln(e*(b*x+a)^n/((d*x+c)^n))*b^4*c^4*h^3*n-6*B*ln(b*x+a)
*a^4*d^4*h^3*n^2+6*B*ln(b*x+a)*b^4*c^4*h^3*n^2-24*A*a*b^3*d^4*g^3*n-24*A*b^4*c*d^3*g^3*n-24*B*x*a^2*b^2*d^4*g*
h^2*n^2+36*B*x*a*b^3*d^4*g^2*h*n^2+24*B*x*b^4*c^2*d^2*g*h^2*n^2-36*B*x*b^4*c*d^3*g^2*h*n^2+24*B*ln(e*(b*x+a)^n
/((d*x+c)^n))*b^4*c^3*d*g*h^2*n-36*B*ln(e*(b*x+a)^n/((d*x+c)^n))*b^4*c^2*d^2*g^2*h*n+24*B*ln(b*x+a)*a^3*b*d^4*
g*h^2*n^2-36*B*ln(b*x+a)*a^2*b^2*d^4*g^2*h*n^2-24*B*ln(b*x+a)*b^4*c^3*d*g*h^2*n^2+36*B*ln(b*x+a)*b^4*c^2*d^2*g
^2*h*n^2+24*B*x^3*ln(e*(b*x+a)^n/((d*x+c)^n))*b^4*d^4*g*h^2*n+36*B*x^2*ln(e*(b*x+a)^n/((d*x+c)^n))*b^4*d^4*g^2
*h*n+12*B*x^2*a*b^3*d^4*g*h^2*n^2+6*B*x^4*ln(e*(b*x+a)^n/((d*x+c)^n))*b^4*d^4*h^3*n+2*B*x^3*a*b^3*d^4*h^3*n^2-
2*B*x^3*b^4*c*d^3*h^3*n^2+24*A*x^3*b^4*d^4*g*h^2*n-3*B*x^2*a^2*b^2*d^4*h^3*n^2+3*B*x^2*b^4*c^2*d^2*h^3*n^2+36*
A*x^2*b^4*d^4*g^2*h*n+24*B*ln(b*x+a)*a*b^3*d^4*g^3*n^2+24*B*x*ln(e*(b*x+a)^n/((d*x+c)^n))*b^4*d^4*g^3*n+6*B*x*
a^3*b*d^4*h^3*n^2-6*B*x*b^4*c^3*d*h^3*n^2+24*B*ln(e*(b*x+a)^n/((d*x+c)^n))*b^4*c*d^3*g^3*n-24*B*ln(b*x+a)*b^4*
c*d^3*g^3*n^2-6*B*a^4*d^4*h^3*n^2+6*B*b^4*c^4*h^3*n^2-3*B*a^3*b*c*d^3*h^3*n^2+24*B*a^3*b*d^4*g*h^2*n^2-36*B*a^
2*b^2*d^4*g^2*h*n^2+3*B*a*b^3*c^3*d*h^3*n^2-24*B*b^4*c^3*d*g*h^2*n^2+36*B*b^4*c^2*d^2*g^2*h*n^2)/b^4/d^4/n

Fricas [B] (verification not implemented)

Leaf count of result is larger than twice the leaf count of optimal. 571 vs. \(2 (224) = 448\).

Time = 0.32 (sec) , antiderivative size = 571, normalized size of antiderivative = 2.42 \[ \int (g+h x)^3 \left (A+B \log \left (e (a+b x)^n (c+d x)^{-n}\right )\right ) \, dx=\frac {6 \, A b^{4} d^{4} h^{3} x^{4} + 2 \, {\left (12 \, A b^{4} d^{4} g h^{2} - {\left (B b^{4} c d^{3} - B a b^{3} d^{4}\right )} h^{3} n\right )} x^{3} + 3 \, {\left (12 \, A b^{4} d^{4} g^{2} h - {\left (4 \, {\left (B b^{4} c d^{3} - B a b^{3} d^{4}\right )} g h^{2} - {\left (B b^{4} c^{2} d^{2} - B a^{2} b^{2} d^{4}\right )} h^{3}\right )} n\right )} x^{2} + 6 \, {\left (4 \, A b^{4} d^{4} g^{3} - {\left (6 \, {\left (B b^{4} c d^{3} - B a b^{3} d^{4}\right )} g^{2} h - 4 \, {\left (B b^{4} c^{2} d^{2} - B a^{2} b^{2} d^{4}\right )} g h^{2} + {\left (B b^{4} c^{3} d - B a^{3} b d^{4}\right )} h^{3}\right )} n\right )} x + 6 \, {\left (B b^{4} d^{4} h^{3} n x^{4} + 4 \, B b^{4} d^{4} g h^{2} n x^{3} + 6 \, B b^{4} d^{4} g^{2} h n x^{2} + 4 \, B b^{4} d^{4} g^{3} n x + {\left (4 \, B a b^{3} d^{4} g^{3} - 6 \, B a^{2} b^{2} d^{4} g^{2} h + 4 \, B a^{3} b d^{4} g h^{2} - B a^{4} d^{4} h^{3}\right )} n\right )} \log \left (b x + a\right ) - 6 \, {\left (B b^{4} d^{4} h^{3} n x^{4} + 4 \, B b^{4} d^{4} g h^{2} n x^{3} + 6 \, B b^{4} d^{4} g^{2} h n x^{2} + 4 \, B b^{4} d^{4} g^{3} n x + {\left (4 \, B b^{4} c d^{3} g^{3} - 6 \, B b^{4} c^{2} d^{2} g^{2} h + 4 \, B b^{4} c^{3} d g h^{2} - B b^{4} c^{4} h^{3}\right )} n\right )} \log \left (d x + c\right ) + 6 \, {\left (B b^{4} d^{4} h^{3} x^{4} + 4 \, B b^{4} d^{4} g h^{2} x^{3} + 6 \, B b^{4} d^{4} g^{2} h x^{2} + 4 \, B b^{4} d^{4} g^{3} x\right )} \log \left (e\right )}{24 \, b^{4} d^{4}} \]

[In]

integrate((h*x+g)^3*(A+B*log(e*(b*x+a)^n/((d*x+c)^n))),x, algorithm="fricas")

[Out]

1/24*(6*A*b^4*d^4*h^3*x^4 + 2*(12*A*b^4*d^4*g*h^2 - (B*b^4*c*d^3 - B*a*b^3*d^4)*h^3*n)*x^3 + 3*(12*A*b^4*d^4*g
^2*h - (4*(B*b^4*c*d^3 - B*a*b^3*d^4)*g*h^2 - (B*b^4*c^2*d^2 - B*a^2*b^2*d^4)*h^3)*n)*x^2 + 6*(4*A*b^4*d^4*g^3
 - (6*(B*b^4*c*d^3 - B*a*b^3*d^4)*g^2*h - 4*(B*b^4*c^2*d^2 - B*a^2*b^2*d^4)*g*h^2 + (B*b^4*c^3*d - B*a^3*b*d^4
)*h^3)*n)*x + 6*(B*b^4*d^4*h^3*n*x^4 + 4*B*b^4*d^4*g*h^2*n*x^3 + 6*B*b^4*d^4*g^2*h*n*x^2 + 4*B*b^4*d^4*g^3*n*x
 + (4*B*a*b^3*d^4*g^3 - 6*B*a^2*b^2*d^4*g^2*h + 4*B*a^3*b*d^4*g*h^2 - B*a^4*d^4*h^3)*n)*log(b*x + a) - 6*(B*b^
4*d^4*h^3*n*x^4 + 4*B*b^4*d^4*g*h^2*n*x^3 + 6*B*b^4*d^4*g^2*h*n*x^2 + 4*B*b^4*d^4*g^3*n*x + (4*B*b^4*c*d^3*g^3
 - 6*B*b^4*c^2*d^2*g^2*h + 4*B*b^4*c^3*d*g*h^2 - B*b^4*c^4*h^3)*n)*log(d*x + c) + 6*(B*b^4*d^4*h^3*x^4 + 4*B*b
^4*d^4*g*h^2*x^3 + 6*B*b^4*d^4*g^2*h*x^2 + 4*B*b^4*d^4*g^3*x)*log(e))/(b^4*d^4)

Sympy [F(-2)]

Exception generated. \[ \int (g+h x)^3 \left (A+B \log \left (e (a+b x)^n (c+d x)^{-n}\right )\right ) \, dx=\text {Exception raised: HeuristicGCDFailed} \]

[In]

integrate((h*x+g)**3*(A+B*ln(e*(b*x+a)**n/((d*x+c)**n))),x)

[Out]

Exception raised: HeuristicGCDFailed >> no luck

Maxima [B] (verification not implemented)

Leaf count of result is larger than twice the leaf count of optimal. 467 vs. \(2 (224) = 448\).

Time = 0.22 (sec) , antiderivative size = 467, normalized size of antiderivative = 1.98 \[ \int (g+h x)^3 \left (A+B \log \left (e (a+b x)^n (c+d x)^{-n}\right )\right ) \, dx=\frac {1}{4} \, B h^{3} x^{4} \log \left (\frac {{\left (b x + a\right )}^{n} e}{{\left (d x + c\right )}^{n}}\right ) + \frac {1}{4} \, A h^{3} x^{4} + B g h^{2} x^{3} \log \left (\frac {{\left (b x + a\right )}^{n} e}{{\left (d x + c\right )}^{n}}\right ) + A g h^{2} x^{3} + \frac {3}{2} \, B g^{2} h x^{2} \log \left (\frac {{\left (b x + a\right )}^{n} e}{{\left (d x + c\right )}^{n}}\right ) + \frac {3}{2} \, A g^{2} h x^{2} + B g^{3} x \log \left (\frac {{\left (b x + a\right )}^{n} e}{{\left (d x + c\right )}^{n}}\right ) + A g^{3} x + \frac {{\left (\frac {a e n \log \left (b x + a\right )}{b} - \frac {c e n \log \left (d x + c\right )}{d}\right )} B g^{3}}{e} - \frac {3 \, {\left (\frac {a^{2} e n \log \left (b x + a\right )}{b^{2}} - \frac {c^{2} e n \log \left (d x + c\right )}{d^{2}} + \frac {{\left (b c e n - a d e n\right )} x}{b d}\right )} B g^{2} h}{2 \, e} + \frac {{\left (\frac {2 \, a^{3} e n \log \left (b x + a\right )}{b^{3}} - \frac {2 \, c^{3} e n \log \left (d x + c\right )}{d^{3}} - \frac {{\left (b^{2} c d e n - a b d^{2} e n\right )} x^{2} - 2 \, {\left (b^{2} c^{2} e n - a^{2} d^{2} e n\right )} x}{b^{2} d^{2}}\right )} B g h^{2}}{2 \, e} - \frac {{\left (\frac {6 \, a^{4} e n \log \left (b x + a\right )}{b^{4}} - \frac {6 \, c^{4} e n \log \left (d x + c\right )}{d^{4}} + \frac {2 \, {\left (b^{3} c d^{2} e n - a b^{2} d^{3} e n\right )} x^{3} - 3 \, {\left (b^{3} c^{2} d e n - a^{2} b d^{3} e n\right )} x^{2} + 6 \, {\left (b^{3} c^{3} e n - a^{3} d^{3} e n\right )} x}{b^{3} d^{3}}\right )} B h^{3}}{24 \, e} \]

[In]

integrate((h*x+g)^3*(A+B*log(e*(b*x+a)^n/((d*x+c)^n))),x, algorithm="maxima")

[Out]

1/4*B*h^3*x^4*log((b*x + a)^n*e/(d*x + c)^n) + 1/4*A*h^3*x^4 + B*g*h^2*x^3*log((b*x + a)^n*e/(d*x + c)^n) + A*
g*h^2*x^3 + 3/2*B*g^2*h*x^2*log((b*x + a)^n*e/(d*x + c)^n) + 3/2*A*g^2*h*x^2 + B*g^3*x*log((b*x + a)^n*e/(d*x
+ c)^n) + A*g^3*x + (a*e*n*log(b*x + a)/b - c*e*n*log(d*x + c)/d)*B*g^3/e - 3/2*(a^2*e*n*log(b*x + a)/b^2 - c^
2*e*n*log(d*x + c)/d^2 + (b*c*e*n - a*d*e*n)*x/(b*d))*B*g^2*h/e + 1/2*(2*a^3*e*n*log(b*x + a)/b^3 - 2*c^3*e*n*
log(d*x + c)/d^3 - ((b^2*c*d*e*n - a*b*d^2*e*n)*x^2 - 2*(b^2*c^2*e*n - a^2*d^2*e*n)*x)/(b^2*d^2))*B*g*h^2/e -
1/24*(6*a^4*e*n*log(b*x + a)/b^4 - 6*c^4*e*n*log(d*x + c)/d^4 + (2*(b^3*c*d^2*e*n - a*b^2*d^3*e*n)*x^3 - 3*(b^
3*c^2*d*e*n - a^2*b*d^3*e*n)*x^2 + 6*(b^3*c^3*e*n - a^3*d^3*e*n)*x)/(b^3*d^3))*B*h^3/e

Giac [F(-1)]

Timed out. \[ \int (g+h x)^3 \left (A+B \log \left (e (a+b x)^n (c+d x)^{-n}\right )\right ) \, dx=\text {Timed out} \]

[In]

integrate((h*x+g)^3*(A+B*log(e*(b*x+a)^n/((d*x+c)^n))),x, algorithm="giac")

[Out]

Timed out

Mupad [B] (verification not implemented)

Time = 1.49 (sec) , antiderivative size = 767, normalized size of antiderivative = 3.25 \[ \int (g+h x)^3 \left (A+B \log \left (e (a+b x)^n (c+d x)^{-n}\right )\right ) \, dx=x\,\left (\frac {4\,A\,b\,d\,g^3+12\,A\,a\,c\,g\,h^2+12\,A\,a\,d\,g^2\,h+12\,A\,b\,c\,g^2\,h+6\,B\,a\,d\,g^2\,h\,n-6\,B\,b\,c\,g^2\,h\,n}{4\,b\,d}+\frac {\left (4\,a\,d+4\,b\,c\right )\,\left (\frac {\left (\frac {4\,A\,a\,d\,h^3+4\,A\,b\,c\,h^3+12\,A\,b\,d\,g\,h^2+B\,a\,d\,h^3\,n-B\,b\,c\,h^3\,n}{4\,b\,d}-\frac {A\,h^3\,\left (4\,a\,d+4\,b\,c\right )}{4\,b\,d}\right )\,\left (4\,a\,d+4\,b\,c\right )}{4\,b\,d}-\frac {4\,A\,a\,c\,h^3+12\,A\,a\,d\,g\,h^2+12\,A\,b\,c\,g\,h^2+12\,A\,b\,d\,g^2\,h+4\,B\,a\,d\,g\,h^2\,n-4\,B\,b\,c\,g\,h^2\,n}{4\,b\,d}+\frac {A\,a\,c\,h^3}{b\,d}\right )}{4\,b\,d}-\frac {a\,c\,\left (\frac {4\,A\,a\,d\,h^3+4\,A\,b\,c\,h^3+12\,A\,b\,d\,g\,h^2+B\,a\,d\,h^3\,n-B\,b\,c\,h^3\,n}{4\,b\,d}-\frac {A\,h^3\,\left (4\,a\,d+4\,b\,c\right )}{4\,b\,d}\right )}{b\,d}\right )+\ln \left (\frac {e\,{\left (a+b\,x\right )}^n}{{\left (c+d\,x\right )}^n}\right )\,\left (B\,g^3\,x+\frac {3\,B\,g^2\,h\,x^2}{2}+B\,g\,h^2\,x^3+\frac {B\,h^3\,x^4}{4}\right )-x^2\,\left (\frac {\left (\frac {4\,A\,a\,d\,h^3+4\,A\,b\,c\,h^3+12\,A\,b\,d\,g\,h^2+B\,a\,d\,h^3\,n-B\,b\,c\,h^3\,n}{4\,b\,d}-\frac {A\,h^3\,\left (4\,a\,d+4\,b\,c\right )}{4\,b\,d}\right )\,\left (4\,a\,d+4\,b\,c\right )}{8\,b\,d}-\frac {4\,A\,a\,c\,h^3+12\,A\,a\,d\,g\,h^2+12\,A\,b\,c\,g\,h^2+12\,A\,b\,d\,g^2\,h+4\,B\,a\,d\,g\,h^2\,n-4\,B\,b\,c\,g\,h^2\,n}{8\,b\,d}+\frac {A\,a\,c\,h^3}{2\,b\,d}\right )+x^3\,\left (\frac {4\,A\,a\,d\,h^3+4\,A\,b\,c\,h^3+12\,A\,b\,d\,g\,h^2+B\,a\,d\,h^3\,n-B\,b\,c\,h^3\,n}{12\,b\,d}-\frac {A\,h^3\,\left (4\,a\,d+4\,b\,c\right )}{12\,b\,d}\right )+\frac {A\,h^3\,x^4}{4}-\frac {\ln \left (a+b\,x\right )\,\left (B\,n\,a^4\,h^3-4\,B\,n\,a^3\,b\,g\,h^2+6\,B\,n\,a^2\,b^2\,g^2\,h-4\,B\,n\,a\,b^3\,g^3\right )}{4\,b^4}+\frac {\ln \left (c+d\,x\right )\,\left (B\,n\,c^4\,h^3-4\,B\,n\,c^3\,d\,g\,h^2+6\,B\,n\,c^2\,d^2\,g^2\,h-4\,B\,n\,c\,d^3\,g^3\right )}{4\,d^4} \]

[In]

int((g + h*x)^3*(A + B*log((e*(a + b*x)^n)/(c + d*x)^n)),x)

[Out]

x*((4*A*b*d*g^3 + 12*A*a*c*g*h^2 + 12*A*a*d*g^2*h + 12*A*b*c*g^2*h + 6*B*a*d*g^2*h*n - 6*B*b*c*g^2*h*n)/(4*b*d
) + ((4*a*d + 4*b*c)*((((4*A*a*d*h^3 + 4*A*b*c*h^3 + 12*A*b*d*g*h^2 + B*a*d*h^3*n - B*b*c*h^3*n)/(4*b*d) - (A*
h^3*(4*a*d + 4*b*c))/(4*b*d))*(4*a*d + 4*b*c))/(4*b*d) - (4*A*a*c*h^3 + 12*A*a*d*g*h^2 + 12*A*b*c*g*h^2 + 12*A
*b*d*g^2*h + 4*B*a*d*g*h^2*n - 4*B*b*c*g*h^2*n)/(4*b*d) + (A*a*c*h^3)/(b*d)))/(4*b*d) - (a*c*((4*A*a*d*h^3 + 4
*A*b*c*h^3 + 12*A*b*d*g*h^2 + B*a*d*h^3*n - B*b*c*h^3*n)/(4*b*d) - (A*h^3*(4*a*d + 4*b*c))/(4*b*d)))/(b*d)) +
log((e*(a + b*x)^n)/(c + d*x)^n)*((B*h^3*x^4)/4 + B*g^3*x + (3*B*g^2*h*x^2)/2 + B*g*h^2*x^3) - x^2*((((4*A*a*d
*h^3 + 4*A*b*c*h^3 + 12*A*b*d*g*h^2 + B*a*d*h^3*n - B*b*c*h^3*n)/(4*b*d) - (A*h^3*(4*a*d + 4*b*c))/(4*b*d))*(4
*a*d + 4*b*c))/(8*b*d) - (4*A*a*c*h^3 + 12*A*a*d*g*h^2 + 12*A*b*c*g*h^2 + 12*A*b*d*g^2*h + 4*B*a*d*g*h^2*n - 4
*B*b*c*g*h^2*n)/(8*b*d) + (A*a*c*h^3)/(2*b*d)) + x^3*((4*A*a*d*h^3 + 4*A*b*c*h^3 + 12*A*b*d*g*h^2 + B*a*d*h^3*
n - B*b*c*h^3*n)/(12*b*d) - (A*h^3*(4*a*d + 4*b*c))/(12*b*d)) + (A*h^3*x^4)/4 - (log(a + b*x)*(B*a^4*h^3*n - 4
*B*a*b^3*g^3*n - 4*B*a^3*b*g*h^2*n + 6*B*a^2*b^2*g^2*h*n))/(4*b^4) + (log(c + d*x)*(B*c^4*h^3*n - 4*B*c*d^3*g^
3*n - 4*B*c^3*d*g*h^2*n + 6*B*c^2*d^2*g^2*h*n))/(4*d^4)